package com.zjxh.zjxh.common.aop;

import io.swagger.annotations.Authorization;
import io.swagger.annotations.Extension;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.ResponseHeader;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Configuration;

/**
 * @author: oyp
 * @date: 2021/4/12 on 2:38 下午
 * @desc: 重写swagger接口注解，新增isSaveLog 注解，配置是否保存日志
 */
@Configuration
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface ApiLog {

  String value();

  String notes() default "";

  String[] tags() default {""};

  Class<?> response() default Void.class;

  String responseContainer() default "";

  String responseReference() default "";

  String httpMethod() default "";

  /**
   * @deprecated
   */
  @Deprecated
  int position() default 0;

  String nickname() default "";

  String produces() default "";

  String consumes() default "";

  String protocols() default "";

  Authorization[] authorizations() default {@Authorization("")};

  boolean hidden() default false;

  ResponseHeader[] responseHeaders() default {@ResponseHeader(name = "", response = Void.class)};

  int code() default 200;

  Extension[] extensions() default {
    @Extension(properties = {@ExtensionProperty(name = "", value = "")})
  };

  boolean ignoreJsonView() default false;

  boolean isSaveLog() default true;
}
